﻿using System.Text.Json;

namespace SqlSharp.Infrastructure;

public class Configuration
{
    public string DatabaseType { get; set; } = null!;
    public string ConnectionString { get; set; } = null!;

    public Dictionary<string, string> TypeMappings { get; init; } = new();

    public static Configuration FromJsonFile(string file)
    {
        var json = File.ReadAllText(file);
        return JsonSerializer.Deserialize<Configuration>(json) ?? new Configuration();
    }
}